﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace System.Data
{
    public static class DataTableHelper
    {
        public static IList<DataRow> Where(this DataTable dtObj, Func<DataRow, bool> predicate)
        {
            //var j = dtObj.AsEnumerable().Select(predicate);

            return dtObj.AsEnumerable().Where(predicate).ToList();
        }

        public static IList<DataRow> AsList(this DataTable dtObj)
        {
            return dtObj.AsEnumerable().ToList();
        }
    }
}
